package com.omf.free;

import android.app.Activity;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.*;
import android.content.*;

public class Menu extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.menu);
        
        // Instantiate start button
        Button start = (Button) findViewById(R.id.start);
        
        // Instantiate credits button
        Button credits_button = (Button) findViewById(R.id.credits);
        
        // Instantiate upgrade button
        Button upgrade = (Button) findViewById(R.id.upgrade);
        
        // Start onClickListener for start
        start.setOnClickListener(new View.OnClickListener() {
			// Override onClick function
			@Override
			public void onClick(View v) {
				// Start Animals_free activity
				Intent start_animals = new Intent(getApplicationContext(), Animals_free.class);
				startActivity(start_animals);
			}
		});
        
        // Start onClickListener for credits
        credits_button.setOnClickListener(new View.OnClickListener() {
			// Override onClick function
			@Override
			public void onClick(View v) {
				// Start credits activity
				Intent start_credits = new Intent(getApplicationContext(), credits.class);
				startActivity(start_credits);
			}
		});
        
        // Start onClickListener for upgrade
        upgrade.setOnClickListener(new View.OnClickListener() {
			// Override onClick function
			@Override
			public void onClick(View arg0) {
				// Save url for full version to string
				String url = "market://details?id=com.cookbook.animals";
				
				// Start browser activity with link to full version of app
				Intent start_browser = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
				startActivity(start_browser);
			}
		});
    }
}